




import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gczn_hd/app/core/values/app_colors.dart';
import 'package:gczn_hd/app/core/values/text_styles.dart';

class GcznRadio extends StatelessWidget{

  final String value;
  final String? groupValue;
  final String label;
  final Color? activeColor;
  final ValueChanged<String> onChanged;

  GcznRadio({
    required this.value,
    required this.label,
    required this.onChanged,
    this.activeColor = AppColors.gcznPrimaryBlueColor,
    this.groupValue,
  });


  @override
  Widget build(BuildContext context) {

    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: (){
        onChanged(value);
      },
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Radio(value: value, groupValue: groupValue, activeColor: activeColor, onChanged: (v){
            onChanged(value);
          }),
          Text(label, style: textStyle,)
        ],
      ),
    );
  }

}